package com.int_tech.car.dao;

import com.int_tech.car.entity.Car;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * Created by Administrator on 2017/9/22.
 */
public interface CarDao extends JpaRepository<Car,Integer>,JpaSpecificationExecutor<Car> {
    Car findCarByCarNumberAndIsDel(String carNumber,int isDel);
    List<Car> findCarByIsDel(Pageable pageable,int isDel);
    List<Car> findCarByIsDel(int isDel);
    List<Car> findCarByStationIdAndIsDel(int stationId,int isDel);
    List<Car> findCarByStationIdAndClientIdAndIsDel(int stationId,int clientId,int isDel);
    List<Car> findCarByClientIdAndIsDel(int clientId,int isDel);
    int countByStationId(Integer id);
    Page<Car> findByClientIdAndIsDel(Pageable pageable,int clientId,int isDel);
    Page<Car> findByIsDel(Pageable pageable,int isDel);

    Car findByCarNumberAndIsDel(String carNumber, int isDel);

    Car findByCarCnumber(String carNumber);

    int countByStationIdAndIsDel(Integer id, int i);

    Page<Car> findByStationIdAndIsDel(Pageable pageable,int stationId,int isDel);

    Page<Car> findByStationIdInAndIsDel(Pageable pageRequest, List<Integer> sids, int i);
}
